﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="angular.js"></script>
    <script src="controller.js"></script>
    <script src="angular.min.js"></script>
</head>
<body ng-app="myApp">
    <div ng-controller="myCtrl">
        <button ng-click="count=count+1">点我</button>


        <p>{{count}}</p>

    </div>

    <div ng-app="myApp" ng-controller="personCtrl">
        <button ng-click="toggle1()">隐藏/显示</button>
        <p ng-hide="myVar">
            姓:<input type="text" ng-model="firstName" /><br />
            姓:<input type="text" ng-model="lastName" />
            姓名 {{firstName+" "+lastName}}
        </p>
    </div>
    <script>
        var app = angular.module("myApp", []);
        app.controller("myCtrl", function ($scope) {
            $scope.count = 0;

        });
        app.controller("personCtrl", function ($scope) {
            $scope.firstName = "Jon";
            $scope.lastName = "Tom";
            $scope.myVar = false;
            $scope.toggle1 = function () {
                $scope.myVar = !$scope.myVar;
            }
        });

    </script>
</body>
</html>
